﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Cache" content="no-cache" />
    <title>诊疗记录详情</title>
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/ligerui-icons.css" />
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/Gray/css/all.css" />
    <link rel="stylesheet" href="~/Content/css/common.css" />
    <script src="~/Scripts/jquery-1.10.2.min.js"  ></script>
    <script src="~/Scripts/ligerUI/js/ligerui.all.js"></script>
    <script src="~/Scripts/common.js?v=@DateTime.Now.ToString("yyyyMMdd")"></script>
    <style>
        .gridtable {
            width: 400px;
            margin: 0px;
        }

            .gridtable td {
                height: 30px;
                line-height: 30px;
            }

        .radio_label {
            display: inline-block;
            width: auto;
            height: 22px;
            background: url(/Content/images/radiobutton.png) no-repeat;
            background-position: -13px -16px;
            text-indent: 22px;
            line-height: 22px;
        }

            .radio_label:hover {
                background-position: -13px -116px;
            }

        .checkbox_label {
            display: inline-block;
            width: auto;
            height: 22px;
            background: url(/Content/images/checkboxbutton.png) no-repeat;
            background-position: -13px -16px;
            text-indent: 22px;
            line-height: 22px;
        }

            .checkbox_label:hover {
                background-position: -13px -116px;
            }

        .checked {
            background-position: -13px -216px;
        }

            .checked:hover {
                background-position: -13px -216px;
            }

        input[type=radio] {
            width: 0;
        }

        input[type=checkbox] {
            width: 0;
        }

        .tabl {
            width: 100%;
            border: solid 1px #f5eeee;
        }

        .tab1 tr td {
            border: solid 1px #f5eeee;
            text-align: center;
        }
    </style>
</head>

<body>
    <div style="margin:10px 0px;">
        <table class="gridtable">
            <tr>
                <td align="center">
                    <div id="maingrid"></div>

                </td>
            </tr>

            <tr>
                <td colspan="2" style="text-align:center;padding-top:10px;">
                    <input id="btnSubmit" type="button" value="确定" class="l-button" onclick="save()" />&nbsp;&nbsp;&nbsp;
                    <input id="btnReset" type="reset" value="重置" class="l-button" />
                </td>
            </tr>
            <tr></tr>
        </table>
    </div>
    <script  >
        
        $(function () {
            BindList(1);
            //alert(parent.$("#txtzljlId").val());
        });
        function getSelected() {
            var rows = $("#maingrid").ligerGrid().getSelectedRows();
            //if (!row) { alert('请选择行'); return; }
            var strVar = "";
            strVar += "<tr><td width=\"100px\">诊疗编码<\/td><td width=\"100px\">诊疗名称<\/td><td style=\"border:none;\" width=\"100px\" rowspan=\"3\" valign=\"top\"><input id=\"btnBind\" type=\"button\" value=\"添加记录\" class=\"l-button\" onclick=\"EditBind(0)\" /><\/td><\/tr> ";
             
            var ids = "";
            var names = "";
            var codes = "";
            for (var i = 0; i < rows.length; i++) {
                ids += rows[i].Id+",";
                names += rows[i].name + ",";
                codes += rows[i].code + ",";
                strVar += "<tr><td>" + rows[i].code + "</td><td>" + rows[i].name + "</td><tr>";
            }
            ids = ids.substr(0, ids.length - 1);
            names = names.substr(0, names.length - 1);
            codes = codes.substr(0, codes.length - 1);
            parent.$("#txtzljlId").val(ids);
            parent.$("#txtzljlName").val(names);
            parent.$("#txtzljlCode").val(codes);
            parent.window.tabInfo.innerHTML = strVar;
        }
        function save() {
            getSelected();
            frameElement.dialog.close();
        }
        function BindList(pageNumber) {
            var queryData = {
                Name: $("#txtName").val(),
                page:1,
                pagesize: 10
            }
            $("#maingrid").ligerGrid({
                height: '100%',
                url: '/ChestPainCenter/DisRecord/Search?ram=' + new Date().getMilliseconds(),
                parms: queryData,
                rownumbers: false,
                heightDiff: -55,
                checkbox: true,
                usePager: false,
                columns: [
                    {
                        display: '诊疗编码', name: 'code', maxWidth: 100
                    },
                {
                    display: '诊疗名称', name: 'name', maxWidth: 100
                }
                ],
                isChecked: function (row) {
                    var ids = parent.$("#txtzljlId").val();
                    if (ids.indexOf(row.Id) >= 0) return true;
                    else return false;
                }
            });
        }
        $(function () {
            //BindList(1);
            //追加样式
            //$("input[type=radio]").parent().addClass("radio_label");
            //if (navigator.userAgent.indexOf("Firefox") > 0) { $(":radio,:checkbox").hide(); }
            //$("input[type=radio][disabled!=disabled]").click(function () {
            //    $("input[type=radio][name='" + $(this).attr('name') + "']").parent().removeClass("checked")
            //    $(this).parent().addClass("checked");
            //});
            //$("input[type=radio][checked=checked]").parent().addClass("checked");
            //$("input[type=checkbox]").parent().addClass("checkbox_label");
            //$("input[type=checkbox][disabled!=disabled]").click(function (e) {
            //    if ($(this).parent().hasClass("checked"))
            //        $(this).parent().removeClass("checked");
            //    else
            //        $(this).parent().addClass("checked");
            //});
            //$("input[type=checkbox][checked=checked]").parent().addClass("checked");
        })
    </script>
</body>
</html>
